package com.wanmao.test;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.TextView;

import com.wanmao.test.bean.XSJLBean;
import com.wanmao.test.service.XSJLService;


public class PatrolDetailsActivity extends BaseActivity {
    private String TAG = "巡视记录详情";
    private String XSJLID;
    private XSJLService xsjlService = new XSJLService(this);
    private XSJLBean xsjlBean;
    private TextView tv_XSLX, tv_XSLJID, tv_XSRY, tv_XSKSSJ, tv_XSJSSJ,tv_XSJG,tv_XSNR;
    private String OBJ_ID, BDZMC, XSRYMC, XSKSSJ, XSJSSJ, XSLX, XSJG, XSNR;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_patrol_details);
        Intent intent = getIntent();
        XSJLID = intent.getStringExtra("XSJLID");
        initData();
        initView();
    }

    private void initData() {
        xsjlBean = xsjlService.findByOBJID(XSJLID);
        if (xsjlBean != null) {
            Log.e(TAG, xsjlBean.toString());
            OBJ_ID = xsjlBean.getOBJ_ID();
            BDZMC = xsjlBean.getBDZMC();
            XSRYMC = xsjlBean.getXSRYMC();
            XSKSSJ = xsjlBean.getXSKSSJ();
            XSJSSJ = xsjlBean.getXSJSSJ();
            XSLX = xsjlBean.getXSLX();
            XSJG = xsjlBean.getXSJG();
            XSNR = xsjlBean.getXSNR();
        }

    }

    private void initView() {
        tv_XSLX= (TextView) findViewById(R.id.tv_XSLX);
        tv_XSLJID= (TextView) findViewById(R.id.tv_XSLJID);
        tv_XSRY= (TextView) findViewById(R.id.tv_XSRY);
        tv_XSKSSJ= (TextView) findViewById(R.id.tv_XSKSSJ);
        tv_XSJSSJ= (TextView) findViewById(R.id.tv_XSJSSJ);
        tv_XSJG= (TextView) findViewById(R.id.tv_XSJG);
        tv_XSNR= (TextView) findViewById(R.id.tv_XSNR);

        tv_XSLX.setText("巡视类型:"+XSLX);
        tv_XSLJID.setText("巡视记录ID:"+OBJ_ID);
        tv_XSRY.setText(XSRYMC);
        tv_XSKSSJ.setText(XSKSSJ);
        tv_XSJSSJ.setText(XSJSSJ);
        tv_XSJG.setText(XSJG);
        tv_XSNR.setText(XSNR);
    }
}
